﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;

namespace Oliving.Edge.Model.Common
{
    public static class ModelReflectionHelper
    {
        public static string GetModelTableName<T>()
        {
            string result = "";
            try
            {
                Type t = typeof(T);
                result = ((SqlSugar.SugarTable)((SqlSugar.SugarTable[])t.GetCustomAttributes(typeof(SugarTable), false))[0]).TableName;
            }
            catch { }

            return result;
        }

    }
}
